﻿/* 加载所有门票、酒店、线路数据 */

/* 加载门票 */
function LoadTicketAll() {
    var _search = [];
    var _order = [];
    _order = [
                {
                    OrderField: "priceOrder", //排序字段
                    OrderType: "asc"
                }
            ];
    var _content = JSON.stringify({
        type: 0,
        conditionParams: {
            Page: {
                PageSize: 30,
                PageIndex: 1
            },
            Search: _search,
            Order: _order
        }
    })

    $$.ajax({
        url: ISS_Constants.Url.defaulturl + ISS_Constants.serviceName.ATTAR,
        data: { "content": _content },
        crossDomain: true,
        method: "POST",
        success: function (data, status) {
            data = JSON.parse(data);
            if (data && data.results && data.results.length > 0) {
                for (var i = 0; i < data.results.length; i++) {
                    ISS_MAP.DrawArc(data.results[i].longitude, data.results[i].latitude, 1, i);
                }
            }
        },
        error: function (xhr, status) { }
    });
}

/* 加载酒店 */
function LoadHotelAll() {
    var _search = [];
    var _order = [];
    _order = [
                {
                    OrderField: "priceOrder", //排序字段
                    OrderType: "asc"
                }
            ];
    var _content = JSON.stringify({
        type: 0,
        conditionParams: {
            Page: {
                PageSize: 30,
                PageIndex: 1
            },
            Search: _search,
            Order: _order
        }
    })

    $$.ajax({
        url: ISS_Constants.Url.defaulturl + ISS_Constants.serviceName.HOTEL,
        data: { "content": _content },
        crossDomain: true,
        method: "POST",
        success: function (data, status) {
            data = JSON.parse(data);
            if (data && data.results && data.results.length > 0) {
                for (var i = 0; i < data.results.length; i++) {
                    ISS_MAP.DrawArc(data.results[i].longitude, data.results[i].latitude, 2, i);
                }
            }
        },
        error: function (xhr, status) { }
    });
}

/* 加载线路 */
function LoadLineAll() {
    var _search = [];
    var _order = [];
    _order = [
                {
                    OrderField: "priceOrder", //排序字段
                    OrderType: "asc"
                }
            ];
    var _content = JSON.stringify({
        type: 0,
        conditionParams: {
            Page: {
                PageSize: 30,
                PageIndex: 1
            },
            Search: _search,
            Order: _order
        }
    })

    $$.ajax({
        url: ISS_Constants.Url.defaulturl + ISS_Constants.serviceName.LINE,
        data: { "content": _content },
        crossDomain: true,
        method: "POST",
        success: function (data, status) {
            data = JSON.parse(data);
            if (data && data.results && data.results.length > 0) {
                for (var i = 0; i < data.results.length; i++) {
                    ISS_MAP.DrawArc(data.results[i].longitude, data.results[i].latitude, 3, i);
                }
            }
        },
        error: function (xhr, status) { }
    });
}